import { ref } from 'vue'
import { defineStore } from 'pinia'

export const useCountsStore = defineStore(
  'count',
  () => {
    const sum = ref(1)
    const school = ref('Ikun学校')
    const arr = ref([1, 2, 3, 4, 5])

    function updataSum(val) {
      sum.value += val
    }

    return { sum, school, arr, updataSum }
  },
  {
    // 自动持久化
    persist: true
  }
)
